home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / usedhtml / completesource.exe / UsingDHTML / AppG / APPGEX05.JS < prev    next >
Encoding:
Text File  |  1997-09-07  |  1.2 KB  |  62 lines

  1. function initFilter(objSelfilt)
  2. {
  3. //main procedure for handling everything involved with filtering
  4. //process
  5.   var imageloc = new String();
  6.   var strFilter = buildFilter(objSelfilt);
  7.  
  8.  
  9. //here the string that specifies filters will be created
  10. imageloc = getimage(grapinput);
  11.  
  12.  
  13. //here the text in changetxt changes (actually, the span tag) 
  14.   changetxt.innerHTML = textinput.value + imageloc
  15.  
  16. //changetxt.innerText = textinput.value;
  17. //here everything is applied
  18.   changetxt.style.filter = strFilter;
  19.   div3.innerText = "SOME_ELEMENT { filter:" + strFilter + ";}";
  20.  
  21. }
  22.  
  23. function buildFilter(objSelfilt)
  24. {
  25. //checks which options are selected then builds the string
  26. var intSelindex = objSelfilt.length;
  27. var strmystring = new String();
  28. for(i=0; i<intSelindex; i++)
  29. {
  30.   if(objSelfilt.options(i).selected == true)
  31.   {
  32.     strmystring += objSelfilt.options(i).value + " ";
  33.   }
  34. }
  35. return strmystring;
  36. }
  37.  
  38.  
  39. function getimage(objgrp)
  40. {
  41. var strmystring = objgrp.value;
  42.   if(strmystring.length > 4)
  43.   {
  44.     return imageloc = " <IMG SRC=" + grapinput.value + ">";
  45.   }
  46.   else
  47.   {return "";}
  48.   
  49. }
  50.  
  51. function restFilter(objfilt)
  52. {
  53.  
  54. objfilt.style.filter=" ";
  55.  
  56.  
  57. }
  58. function udv()
  59. {
  60. div3.innerText = selfilt.options(myindex).value;
  61. }
  62.